package com.sample.BouncingBall;

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Color;



public class Ball {
private int radius, x, y, xVel, yVel, ID, color, yMomentum;
//private Bitmap img;
private boolean yIsNegative,xIsNegative;


public Ball(int radius, int x, int y, int xVel, int yVel, int color, int ID){
this.x=x;
this.y=y;
this.xVel=xVel;
this.yVel=yVel;
this.color=color;
this.radius=radius;
this.ID=ID;
}
public Ball(/*Context context, int drawable*/){
//BitmapFactory.Options opts= new BitmapFactory.Options();
//opts.inJustDecodeBounds=true;
//img=BitmapFactory.decodeResource(context.getResources(), drawable);
x=50;
y=50;
xVel=15;
yVel=15;
color=Color.BLUE;
radius=1;
ID=1;
yIsNegative=false;
xIsNegative=false;
}
/*public Bitmap getImage(){
return img;	
}*/
public void setID(int id){
ID=id;	
}
public void setRadius(int radius2){
radius=radius2;	
}
public void setX(int X){
x=X;	
}
public void setY(int Y){
y=Y;	
}
public void setxVel(int Vel){
xVel=Vel;	
}
public void setyVel(int Vel){
yVel=Vel;	
}
public void setColor(int colour){
color=colour;	
}
public void setYDirection(boolean value){
yIsNegative=value;
}
public int getID(){
return ID;	
}
public int getX(){
return x;	
}
public int getY(){
return y;	
}
public int getxVel(){
return xVel;	
}
public int getyVel(){
return yVel;	
}
public int getColor(){
return color;	
}
public int getRadius(){
return radius;	
}
public boolean getBallDirection(){
return xIsNegative;	
}
public void setXDirection(boolean value){
xIsNegative=value;
}
public void move(int speed, int momentum){		
xVel=speed;
yVel=speed+momentum;
if (yVel<10){
yVel=10;	
}
if(x<=25){
xIsNegative=false;	
}
if(x>=460){
xIsNegative=true;
}
if (xIsNegative==true){
xVel=-xVel;	
}
if (yIsNegative==true){
yVel=-yVel;	
}
x+=xVel;
y+=yVel;
}
}
